class Places < Application
	before :find_place, :exclude => [ :new, :create, :index ]

	def show
		provides :html, :atom, :pnml
                
		case content_type
		when :html
			render
		when :atom
			CGI::unescapeHTML(@place.to_atom.to_s)
		when :pnml
			@place.to_pnml
		end
	end
	
	def update
      @place.feed_url = params["feed_url"] if params["feed_url"]
      @place.read_only = (params["read_only"] == "true") if params["read_only"]
      @place.save!
	  headers["Location"] = request.referer
	end
	
	private
	def find_place
		@place = PNEngine::Place.find(params[:id])
	end
end